From f74aaf0571283d233bd778b94d2ac49ed3c0dd42 Mon Sep 17 00:00:00 2001 From: robertl Date: Mon, 27 Nov 2006 20:59:32 +0000 Subject: [PATCH] Tweak return of xvasprintf() to make it match Linux & FreeBSD behaviour. --- util.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/util.c b/util.c index 2dc7ed9b9..1849e9bd8 100644 --- a/util.c +++ b/util.c @@ -288,6 +288,11 @@ xfputs(const char *errtxt, const char *s, FILE *stream) /* * Allocate a string using a format list with optional arguments + * Returns -1 on error. + * If return value is anything else, *strp will be populated with an + * allocated string containging the formatted buffer. + * + * Freeing that is the responsbility of the caller. */ int @@ -361,7 +366,7 @@ xasprintf(char **strp, const char *fmt, ...) } } *strp = buf; - return 0; + return outsize; } /* -- 2.30.2